package com.xtourms.client.rm.hotel;

import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
import com.xtourms.shared.field.HotelField;

public class HotelDetail extends DialogBox {

	private static HotelDetailUiBinder uiBinder = GWT
			.create(HotelDetailUiBinder.class);

	interface HotelDetailUiBinder extends UiBinder<Widget, HotelDetail> {
	}

	
	public HotelDetail(JSONObject hotelInfo){
		setWidget(uiBinder.createAndBindUi(this));
		setAnimationEnabled(true);
		setAutoHideEnabled(true);
		init(hotelInfo);
	}
	
	@UiField Label province;
	@UiField Label city;
	@UiField Label hotel_add;
	@UiField Label hotel_des;
	@UiField Label hotel_lv;
	@UiField Label hotel_fex;
	@UiField Label hotel_tel;
	
	@UiField Label manager_name;
	@UiField Label manager_mobile;
	@UiField Label linkman_name;
	@UiField Label linkman_mobile;
	@UiField Label linkman_qq;
		
	@UiField Label symbiosis;
	@UiField Label start_date;
	@UiField Label end_date;
	
	private void init(JSONObject hotel){
		setText(((JSONString)hotel.get(HotelField.HOTEL_NAME)).stringValue());
		province.setText(((JSONString)hotel.get(HotelField.HOTEL_PROVINCE_NAME)).stringValue());
		city.setText(((JSONString)hotel.get(HotelField.HOTEL_CITY_NAME)).stringValue());
		hotel_add.setText(((JSONString)hotel.get(HotelField.HOTEL_ADD)).stringValue());
		hotel_des.setText(((JSONString)hotel.get(HotelField.HOTEL_DES)).stringValue());
		hotel_lv.setText(((JSONString)hotel.get(HotelField.HOTEL_LV)).stringValue());
		hotel_fex.setText(((JSONString)hotel.get(HotelField.HOTEL_FEX)).stringValue());
		hotel_tel.setText(((JSONString)hotel.get(HotelField.HOTEL_NAME)).stringValue());
		
		manager_name.setText(((JSONString)hotel.get(HotelField.HOTEL_MANAGER_NAME)).stringValue());
		manager_mobile.setText(((JSONString)hotel.get(HotelField.HOTEL_MANAGER_MOBILE)).stringValue());
		linkman_name.setText(((JSONString)hotel.get(HotelField.HOTEL_LINKMAN_NAME)).stringValue());
		linkman_mobile.setText(((JSONString)hotel.get(HotelField.HOTEL_LINKMAN_MOBILE)).stringValue());
		linkman_qq.setText(((JSONString)hotel.get(HotelField.HOTEL_LINKMAN_QQ)).stringValue());
		
		symbiosis.setText(((JSONString)hotel.get(HotelField.HOTEL_SYMBIOSIS)).stringValue());
		start_date.setText(((JSONString)hotel.get(HotelField.HOTEL_START_DATE)).stringValue());
		end_date.setText(((JSONString)hotel.get(HotelField.HOTEL_END_DATE)).stringValue());
		
	}
	
}
